<?php
// 连接数据库
$link = mysqli_connect("localhost","root","root","2108");
if(!$link){
    die("连接数据库失败");
}

$l = $_GET['l'];
$id = $_COOKIE['id'];
// 连接数据库
$sql = "UPDATE `only-details` SET `l` = '$l' WHERE `id` = '$id'";
// echo json_encode($sql);
$res = mysqli_query($link,$sql);
// echo $sql;
// die();

// $row = mysqli_fetch_assoc($res);
$arr=[];
if($res){
    $arr = [
        "meta"=>[
            "status"=>1,
            "msg"=>"修改成功"
        ]
    ];
}
else{
    $arr = [
        "meta"=>[
            "status"=>0,
            "msg"=>"修改失败"
        ]
    ];
}

echo json_encode($arr);
?>